import { getApplicationContainer } from '../../../get-application-container';
import {UserInfoModel } from "../models/user-info-model";
import { ResponseDataModel,PaginationResponseModel } from './../../service/http/response-data-model';


export interface IUserInfoParams {
    avatarUrl: string;
    city: string;
    country: string;
    nickName: string;
    province: string;
    traceUid: string;
    userId: number;
}
export const userService = {
    /**
     * 登陆
     * @param code 
     */
    login: (code: string) => {
        return getApplicationContainer().httpService.json<string>('/treasure/auth/mini-login-register', {code});
    },
    /**
     * 更新用户信息
     * @param data 
     */
    updateUserInfo: (data: IUserInfoParams) => {
        return getApplicationContainer().httpService.json<any>('/treasure/community/user/mini/update', data)
    },
    /**
     * 用户详情
     * @param data 
     */
    queryUserDetail: () => {
        return getApplicationContainer().httpService.json<UserInfoModel>('/treasure/community/user/detail')
    }

}

